<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看优惠券详情</title>
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css"/>
    <link rel="stylesheet" href="/css/Coupons/aaa.css"/>
</head>
<body>
<div class="layui-form-item" id="details">
    <div class="layui-form-item" id="div——id">
        <div class="layui-inline">
            <label class="layui-form-label label">优惠券编号：</label>
            <div class="layui-input-inline">
                <input type="text" name="couponCode"  class="layui-input" disabled="disabled">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label label">优惠券名称：</label>
            <div class="layui-input-inline">
                <input type="text" name="couponName" class="layui-input" disabled="disabled">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ">开始时间：</label>
            <div class="layui-input-inline">
                <input type="text" name="startDate" class="layui-input" disabled="disabled">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">结束时间：</label>
            <div class="layui-input-inline">
                <input type="text" name="endDate" class="layui-input" disabled="disabled">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label label">优惠券状态：</label>
            <div class="layui-input-inline">
                <input type="text" name="online" class="layui-input" disabled="disabled">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label label">获取方式：</label>
            <div class="layui-input-inline">
                <input type="text" name="mode" class="layui-input" disabled="disabled">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label label">优惠券数量：</label>
        <div class="layui-input-inline">
            <input type="text" name="surplus" class="layui-input" disabled="disabled" id="surplus" >
        </div>
    </div>
</div>
<script>
    var form;
    var $;
    var table;
    var layer;
    layui.use(['form','jquery','table','layer'],function(){
        form=layui.form;
        $=layui.$;
        table=layui.table;
        layer=layui.layer;


        var Coupons = JSON.parse(localStorage.getItem("Coupons"));
        couponId = Coupons[0].couponId;

        //是否上线
        if(Coupons[0].online == 2){
            Coupons[0].online = "上线";
        }else if(Coupons[0].online == 3){
            Coupons[0].online = "下线";
        }

        //发放方式
        if(Coupons[0].grant == 2){
            Coupons[0].grant = "自动发放";
        }else if(Coupons[0].grant == 3){
            Coupons[0].grant = "活动领取";
        }else if(Coupons[0].grant == 4){
            Coupons[0].grant = "人工发放";
        }else if(Coupons[0].grant == 5){
            Coupons[0].grant = "无限制";
        }

        $('input[name=couponCode]').val(Coupons[0].couponCode);
        $('input[name=couponName]').val(Coupons[0].couponName);
        $('input[name=startDate]').val(Coupons[0].startDate);
        $('input[name=endDate]').val(Coupons[0].endDate);
        $('input[name=online]').val(Coupons[0].online);
        $('input[name=mode]').val(Coupons[0].grant);
        $('input[name=surplus]').val(Coupons[0].issueQuantity);

    });
</script>
</body>
</html>